home *** CD-ROM | disk | FTP | other *** search
/ FM Towns: Free Software Collection 10 / FM Towns Free Software Collection 10.iso / taropyon / edia / ccisrc / lib.c < prev    next >
C/C++ Source or Header  |  1993-11-07  |  1KB  |  52 lines

  1.  
  2. /*************************************************************************
  3. *    時間表記
  4. *************************************************************************/
  5.  
  6. #ifndef    TM_SEC
  7. #define    TM_SEC(tm)        (tm[0])    /* 0...59        */
  8. #define    TM_MIN(tm)        (tm[1])    /* 0...59        */
  9. #define    TM_HOUR(tm)        (tm[2])    /* 0...23        */
  10. #define    TM_MDAY(tm)        (tm[3])    /* 1...31        */
  11. #define    TM_MON(tm)        (tm[4])    /* 0...11        */
  12. #define    TM_YEAR(tm)        (tm[5])    /* 1900...        */
  13. #define    TM_WDAY(tm)        (tm[6])    /* Sunday 0...6    */
  14. #define    TM_YDAY(tm)        (tm[7])    /* 0...365        */
  15. #define    TM_ISDST(tm)    (tm[8])    /* daylight     */
  16. #endif
  17.  
  18. char    *GetAsciiTime( char *s, long t )
  19. {
  20.     int        *tm;
  21.  
  22.     tm = localtime( &t );
  23.     sprintf( s, "%04d/%02d/%02d %02d:%02d", 
  24.         TM_YEAR(tm)+1900, TM_MON(tm)+1, TM_MDAY(tm),
  25.         TM_HOUR(tm), TM_MIN(tm) );
  26.     return (s);
  27. }
  28.  
  29. int        TxdUsr_saveColTbl( char *txd )
  30. {
  31.     int        ret;
  32.     char    *fdl;
  33.     char    tmp[128], *fn;
  34.  
  35.     if ( (fdl = FDL_open(0)) == NULL )
  36.         return (ERR);
  37.     FDL_set_wildcard( fdl, "*.tbl");
  38.     FDL_set_title( fdl, "SAVE COLOR TABLE");
  39.     ret = FDL_start(fdl);
  40.     fn  = FDL_get_filename(fdl);
  41.     if ( ret != NORMAL || strlen(fn) == 0 )
  42.     {
  43.         FDL_close(fdl);
  44.         return (ERR);
  45.     }
  46.     FS_appendSnam( tmp, fn, ".tbl");
  47.     TXD_saveColTbl(txd,tmp);
  48.     FDL_close(fdl);
  49.  
  50.     return (NORMAL);
  51. }
  52.